<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>修改手机号</title>
    <link rel="stylesheet" type="text/css" href="css/swiper.min.css" />
	   <link href="css/choose.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/aui.css" />
		<link rel="stylesheet" type="text/css" href="css/main.css" />
</head>
<body>
    <div class="site-name">
      <p>北京114预约挂号平台</p>
    </div>

    <div class="phone-container">
      <div class="phone-wrapper">
        <div class="phone-title">
            <p id="bq"></p>
        </div>

        <div class="phone-list">
          <div class="phone-item">
            <div class="phone-left">
              <p id="a">手机号</p>
            </div>
            <div class="phone-right">
              <div class="phone-input">
                <input id="left"  placeholder="请输入手机号" />
              </div>
            </div>
          </div>

          <div class="phone-item">
            <div class="phone-left">
              <p>验证码</p>
            </div>
            <div class="phone-right">
              <div class="phone-input">
                <input id="code" placeholder="请输入验证码" />
              </div>
              <i id="aaaa" class="getcode">获取验证码</i>
            </div>
          </div>

        </div>

        <div class="add-btn" id="phone">
          <a id="confirm">确认修改</a>
        </div>
      </div>
    </div>

</body>
<script src="js/jquery.min.js"></script>
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/url.js"></script>
<script type="text/javascript">

    aa();
    function aa(){
        $.ajax({
            url: getUrl() + "wechat114/platform/acquisitionSession",
            success: function (data) {
                $("#bq").html("当前登陆手机号:"+data.toString())
            }
        })
    }

    $("#aaaa").click(function() {
        alert("验证码：111111")
    })

    $("#confirm").click(function() {
        if (aa()==null){
            $.ajax({
                Type: "post",
                url: getUrl() + "wechat114/platform/update",
                data: {"platformPhone": $("#left").val(), "code": $("#code").val()},
                dataType: "json",
                success: function (data) {
                    alert("修改成功！")
                    window.location.replace(getUrl() +"center.html");
                }
            })
        } else{
            alert("请先登陆");
            window.location.replace(getUrl() +"login.html");
        }

    })

</script>
</html>
